﻿<Window x:Class="RL.wRouteListItem"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Путевой лист" Height="600" Width="1024" xmlns:my="clr-namespace:RL" Loaded="Window_Loaded" Closing="Window_Closing" x:Name="RouteListItemWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <Window.Resources>
        <CollectionViewSource x:Key="sourceScheduleRL" />
        <CollectionViewSource x:Key="sourceInfoRL" />
        <CollectionViewSource x:Key="vokzalTableViewSource" d:DesignSource="{d:DesignInstance my:VokzalTable, CreateList=True}" />
    </Window.Resources>
    <TabControl >
        <TabItem Header="Основная" >
            <Grid x:Name="mainRouteListGrid">
                <my:ucSelectPerson HorizontalAlignment="Left" Margin="107,43,0,0" x:Name="ucSelectPerson1" VerticalAlignment="Top" DriverID="{Binding Path=id_driver, Mode=TwoWay}" />
                <Label Content="Номер" Height="28" HorizontalAlignment="Left" Margin="12,12,0,0" Name="label1" VerticalAlignment="Top" />
                <Label Content="Дата" Height="28" HorizontalAlignment="Left" Margin="199,15,0,0" Name="label2" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="65,17,0,0" Name="textBoxNumber" VerticalAlignment="Top" Width="120" Text="{Binding Path=nomdog}"/>
                <Label Content="Водитель" Height="28" HorizontalAlignment="Left" Margin="12,44,0,0" Name="label3" VerticalAlignment="Top" />
                <Label Content="Выход" Height="28" HorizontalAlignment="Left" Margin="414,12,0,0" Name="label4" VerticalAlignment="Top" />
                <TextBox Height="23" HorizontalAlignment="Right" Margin="0,17,418,0" Name="textBoxNumDeparture" VerticalAlignment="Top" Width="120" Text="{Binding Path=nomdeparture}"/>
                <!--<TextBox Height="25" HorizontalAlignment="Left" Margin="240,16,0,0" Name="textBoxDate" VerticalAlignment="Top" Width="153" Text="{Binding Path=datedoc}" />-->
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="240,16,0,0" Name="textBoxDate" VerticalAlignment="Top" Width="153" SelectedDate="{Binding Path=dt_datedoc}" />
                <my:ucRouteInfoRL HorizontalAlignment="Left" Margin="12,106,0,0" x:Name="ucRouteInfoRL1" VerticalAlignment="Top" Width="543" DataContext="{Binding}"/>
                <my:ucScheduleRL HorizontalAlignment="Left" Margin="559,106,0,0" x:Name="ucScheduleRL1" VerticalAlignment="Top" Height="166" Width="431" RouteList="{Binding ElementName=mainRouteListGrid, Path=DataContext,Mode=OneWay}" ContextDB="{Binding ElementName=mainRouteListGrid, Path=ContextDB,Mode=OneWay}"/>
                <my:ucInfoRL HorizontalAlignment="Left" Margin="12,278,0,0" x:Name="ucInfoRL1" VerticalAlignment="Top" Height="148" Width="809" RouteList="{Binding ElementName=mainRouteListGrid, Path=DataContext,Mode=OneWay}" ContextDB="{Binding ElementName=mainRouteListGrid, Path=ContextDB,Mode=OneWay}"/>
                <Label Content="Автомобиль" Height="28" HorizontalAlignment="Left" Margin="12,72,0,0" Name="label5" VerticalAlignment="Top" />
                <my:ucSelectVehicle HorizontalAlignment="Left" Margin="107,0,0,430" x:Name="ucSelectVehicle1" VerticalAlignment="Bottom" VehicleID="{Binding Path=id_vehicle, Mode=TwoWay}"/>
                <StackPanel Height="35" HorizontalAlignment="Left" Margin="12,449,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="978" Orientation="Horizontal">
                    <Button Content="OK" Height="23" Name="buttonOK" Width="75" Click="buttonOK_Click"/>
                    <Button Content="Печать" Height="23" Name="buttonPrint" Width="75" Click="buttonPrint_Click" />
                </StackPanel>
                <Button Content="Загрузить" Height="23" HorizontalAlignment="Left" Margin="599,15,0,0" Name="buttonLoad" VerticalAlignment="Top" Width="75" Click="buttonLoad_Click" />
                <Label Content="Сумма по вокзальным ведомостям: " Height="28" HorizontalAlignment="Left" Margin="420,44,0,0" Name="labelSummVed" VerticalAlignment="Top" />
                <Label Content="Сумма стр. сбор: " Height="28" HorizontalAlignment="Left" Margin="420,72,0,0" Name="labelSumInsVed" VerticalAlignment="Top" />
            </Grid>
        </TabItem>
        <TabItem Header="Вокзальные ведомости">
            <DataGrid AutoGenerateColumns="False" EnableRowVirtualization="True" ItemsSource="{Binding Source={StaticResource vokzalTableViewSource}}" Name="vokzalTableDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" MouseDoubleClick="vokzalTableDataGrid_MouseDoubleClick">
                <DataGrid.Columns>
                    <!--<DataGridTemplateColumn x:Name="datedocColumn" Header="datedoc" Width="SizeToHeader">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <DatePicker SelectedDate="{Binding Path=datedoc, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>-->
                    <DataGridTextColumn x:Name="datedocColumn" Binding="{Binding Path=datedoc, Mode=OneWay}" Header="Дата" Width="80" />
                    <DataGridTextColumn x:Name="numdocColumn" Binding="{Binding Path=numdoc, Mode=OneWay}" Header="Номер" Width="180" />
                    <DataGridTextColumn x:Name="time_departureColumn" Binding="{Binding Path=time_departure, Mode=OneWay}" Header="Время вых." Width="SizeToHeader" />
                    <DataGridTextColumn x:Name="station" Binding="{Binding Path=Station.name}" Header="Автостанция" Width="100" />
                    <DataGridTextColumn x:Name="route" Binding="{Binding Path=Routes.number}" Header="Маршрут" Width="100" />
                    <DataGridTextColumn x:Name="routeN" Binding="{Binding Path=Routes.name}" Header="Наименование" Width="100" />
                    <DataGridTextColumn x:Name="qnt_ticketsColumn" Binding="{Binding Path=qnt_tickets, Mode=OneWay}" Header="Кол-во билетов" Width="SizeToHeader" />
                    <DataGridTextColumn x:Name="summa_ticketsColumn" Binding="{Binding Path=summa_tickets, Mode=OneWay}" Header="Сумма билетов" Width="SizeToHeader" />
                    <DataGridTextColumn x:Name="summa_bagazhColumn" Binding="{Binding Path=bagazh, Mode=OneWay}" Header="Багаж" Width="SizeToHeader" />
                    <DataGridTextColumn x:Name="sum_insuranceColumn" Binding="{Binding Path=sum_insurance, Mode=OneWay}" Header="Страх. сбор." Width="SizeToHeader" />
                    <DataGridCheckBoxColumn x:Name="delColumn" Binding="{Binding Path=del, Mode=OneWay}" Header="Выкл." Width="SizeToHeader" />
                    
                </DataGrid.Columns>
            </DataGrid>
        </TabItem>
    </TabControl>
</Window>
